#ifndef _WT_EXECUTE_H
#define _WT_EXECUTE_H

typedef struct WtExecutionStateT
{
  WtContext *context;
  Tcl_Interp *interp;
  Tcl_Obj *requestedPath;
  Tcl_Obj *targetPath;
  Tcl_Obj *useNamespace;
  Tcl_Obj *genCode;
} WtExecutionState;

int WtFindAndExecuteFile(WtContext *w, Tcl_Obj *requestedPath);
Tcl_Obj *WtFindFile(WtExecutionState *execState);
Tcl_Obj *WtResolvePath(WtContext *w, Tcl_Obj *requestedPath, Tcl_Obj *dirs);
int WtExecuteFile(WtExecutionState *execState);
int WtExecuteString(WtExecutionState *execState, Tcl_Obj *string, int len);
int WtParseString(WtExecutionState *execState, Tcl_Obj *string, int len);
void WtParserAddCode(WtExecutionState *execState, char *buf, int len);
void WtParserAddExpr(WtExecutionState *execState, char *buf, int len);
void WtParserAddContent(WtExecutionState *execState, char *buf, int len);
void WtExecuteRequest(WtContext *w, const char *requestedPath);
void WtHandleExecutionError(WtExecutionState *execState);

#endif /* !_WT_EXECUTE_H */
